package net.rlair.sbdemo.dao.jdbctemplate.base;

import java.io.Serializable;
import java.util.List;

/**
 * @author:
 * @description:
 * @create:2019-03-25 9:47
 */
public class Page<T> implements Serializable {
    //总记录数
    private Long total;

    //结果集
    private List<T> rows;

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public static <T> Page<T> result(Long total, List<T> rows) {
        return new Page<>(total, rows);
    }

    public Page(Long total, List<T> rows) {
        this.total = total;
        this.rows = rows;
    }
}
